import { ref as I, watch as G, onMounted as E, openBlock as D, createElementBlock as N, renderSlot as k, createElementVNode as w, useCssVars as V, computed as x, reactive as U, Fragment as v, renderList as L, normalizeStyle as O, toDisplayString as T, normalizeClass as q } from "vue";
function Y(e, l = 500, t = !1) {
  let i = null;
  function r(...n) {
    if (clearTimeout(i), t) {
      const u = !i;
      i = setTimeout(() => {
        i = null;
      }, l), u && e.apply(this, n);
    } else
      i = setTimeout(() => {
        e.apply(this, n);
      }, l);
  }
  return r;
}
function _(e, l = 1e3) {
  let t = null;
  function i(...r) {
    t === null && (e.apply(this, r), t = setTimeout(() => {
      clearTimeout(t), t = null;
    }, l));
  }
  return i;
}
function Z(e, l = () => {
}, t = () => {
}) {
  const i = new IntersectionObserver((r) => {
    r[0].intersectionRatio <= 0 ? t == null || t() : l == null || l();
  });
  return i.observe(e), () => i.disconnect();
}
function J(e, l = () => {
}) {
  const t = new ResizeObserver((i) => {
    l(i[0].target);
  });
  return t.observe(e), () => t.disconnect();
}
function j(e = !1) {
  const l = Math.floor(Math.random() * 256), t = Math.floor(Math.random() * 256), i = Math.floor(Math.random() * 256), r = Math.floor(Math.random() * 10);
  return `rgba(${l},${t},${i},${e ? r : 1})`;
}
const Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  debounce: Y,
  interPage: Z,
  randomColor: j,
  resizeListen: J,
  throttle: _
}, Symbol.toStringTag, { value: "Module" })), $ = { class: "seyu-above" }, ee = /* @__PURE__ */ Object.assign({
  name: "FloatDown",
  inheritAttrs: !1
}, {
  __name: "FloatDown",
  props: {
    // 飘落图片列表
    imgList: {
      type: Array,
      default: () => [""]
    },
    // 图片最小宽
    minWidth: {
      type: Number,
      default: 30,
      validator: (e) => e > 0
    },
    // 图片最小高
    minHeight: {
      type: Number,
      default: 25,
      validator: (e) => e > 0
    },
    // 数量
    count: {
      type: Number,
      default: 10,
      validator: (e) => e > 0
    },
    // 横向移动速度
    xSpeed: {
      type: Number,
      default: 1,
      validator: (e) => e > 0
    },
    // 纵向移动速度
    ySpeed: {
      type: Number,
      default: 1,
      validator: (e) => e > 0
    },
    // 飘落方向
    direction: {
      type: String,
      default: "left",
      validator: (e) => ["left", "right"].includes(e)
    },
    // 禁止旋转
    disableRotate: {
      type: Boolean,
      default: !1
    }
  },
  setup(e, { expose: l }) {
    const t = e, i = I(), r = I();
    let n;
    function u() {
      r.value.width = i.value.clientWidth, r.value.height = i.value.clientHeight;
    }
    const A = I([]);
    async function c() {
      await Promise.all(t.imgList.map((s) => new Promise((d) => {
        const y = new Image();
        y.src = s, y.onload = () => {
          A.value.push(y), d(!0);
        }, y.onerror = () => {
          console.error(`图片加载失败: ${s}`), d(!1);
        };
      })));
    }
    G(
      () => t.imgList,
      c
    );
    const a = I([]);
    function o() {
      a.value = [];
      const { minWidth: s, minHeight: d, xSpeed: y, ySpeed: f } = t;
      for (let R = 0; R < t.count; R++) {
        const m = Math.random();
        a.value.push({
          // 坐标
          x: Math.random() * r.value.width,
          y: Math.random() * r.value.height * 2 - r.value.height,
          // 移动速度
          xSpeed: Math.random() * y + 1,
          ySpeed: Math.random() * f + 1,
          // 图片
          width: m * (s / 2) + s,
          height: m * (d / 2) + d,
          image: A.value[parseInt(String(Math.random() * A.value.length))],
          // 旋转
          rotate: Math.random() * 360,
          rotateSpeed: Math.random() * 4 - 2
        });
      }
    }
    function h() {
      n.clearRect(0, 0, r.value.width, r.value.height), a.value.forEach((s) => {
        const d = Math.sqrt(s.width * s.width + s.height * s.height);
        s.x > r.value.width + d && t.direction === "right" || s.x < -d && t.direction === "left" ? (s.x = t.direction === "right" ? -s.width : r.value.width + d, s.image = A.value[parseInt(String(Math.random() * A.value.length))]) : s.y > r.value.height + d && (s.y = -d, s.image = A.value[parseInt(String(Math.random() * A.value.length))]), t.disableRotate ? n.drawImage(s.image, s.x, s.y, s.width, s.height) : (n.save(), n.translate(s.x, s.y), n.rotate(s.rotate * Math.PI / 180), n.drawImage(
          s.image,
          -s.width / 2,
          -s.height / 2,
          s.width,
          s.height
        ), n.restore());
      });
    }
    const g = I(!0);
    G(g, () => {
      g.value && B();
    });
    const p = I(!0);
    function B() {
      a.value.forEach((s) => {
        s.x += t.direction === "left" ? -s.xSpeed : s.xSpeed, s.y += s.ySpeed, s.rotate += s.rotateSpeed;
      }), r.value && h(), g.value && p.value && requestAnimationFrame(B);
    }
    return E(async () => {
      await c(), J(i.value, Y(u)), Z(
        i.value,
        () => {
          p.value = !0, g.value && B(), u(), o();
        },
        () => {
          p.value = !1;
        }
      ), n = r.value.getContext("2d");
    }), l({
      start: (s = !0) => {
        s && o(), g.value = !0;
      },
      stop: (s = !0) => {
        g.value = !1, s && requestAnimationFrame(() => {
          n.clearRect(0, 0, r.value.width, r.value.height);
        });
      }
    }), (s, d) => (D(), N("div", {
      class: "seyu-shell",
      ref_key: "floatDown",
      ref: i
    }, [
      k(s.$slots, "default"),
      w("canvas", {
        ref_key: "canvas",
        ref: r,
        class: "seyu-canvas"
      }, null, 512),
      w("div", $, [
        k(s.$slots, "above")
      ])
    ], 512));
  }
}), F = [
  "零",
  "一",
  "二",
  "三",
  "四",
  "五",
  "六",
  "七",
  "八",
  "九",
  "十",
  "十一",
  "十二",
  "十三",
  "十四",
  "十五",
  "十六",
  "十七",
  "十八",
  "十九",
  "二十",
  "二十一",
  "二十二",
  "二十三",
  "二十四",
  "二十五",
  "二十六",
  "二十七",
  "二十八",
  "二十九",
  "三十",
  "三十一",
  "三十二",
  "三十三",
  "三十四",
  "三十五",
  "三十六",
  "三十七",
  "三十八",
  "三十九",
  "四十",
  "四十一",
  "四十二",
  "四十三",
  "四十四",
  "四十五",
  "四十六",
  "四十七",
  "四十八",
  "四十九",
  "五十",
  "五十一",
  "五十二",
  "五十三",
  "五十四",
  "五十五",
  "五十六",
  "五十七",
  "五十八",
  "五十九",
  "六十"
];
function W(e) {
  return e ? ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"] : ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
}
function S(e, l, t, i = 1) {
  const r = [];
  for (let n = 0; n < e; n++)
    r.push(`${l ? F[n + i] : n + i}${t}`);
  return r;
}
const te = {
  Month: () => ({
    labelList: S(12, !0, "月"),
    length: 12,
    textLength: 3,
    prop: "month"
  }),
  month: () => ({
    labelList: S(12, !1, "月"),
    length: 12,
    textLength: 2.5,
    prop: "month"
  }),
  Day: () => ({
    labelList: S(31, !0, "日"),
    length: 31,
    textLength: 4,
    prop: "day"
  }),
  day: () => ({
    labelList: S(31, !1, "日"),
    length: 31,
    textLength: 2.5,
    prop: "day"
  }),
  Week: () => ({
    labelList: W(!0),
    length: 7,
    textLength: 3,
    prop: "week"
  }),
  week: () => ({
    labelList: W(!1),
    length: 7,
    textLength: 2,
    prop: "week"
  }),
  Hour: () => ({
    labelList: S(24, !0, "时", 0),
    length: 24,
    textLength: 4,
    prop: "hour"
  }),
  hour: () => ({
    labelList: S(24, !1, "点", 0),
    length: 24,
    textLength: 2.5,
    prop: "hour"
  }),
  Minute: () => ({
    labelList: S(60, !0, "分", 0),
    length: 60,
    textLength: 4,
    prop: "minute"
  }),
  minute: () => ({
    labelList: S(60, !1, "分", 0),
    length: 60,
    textLength: 2.5,
    prop: "minute"
  }),
  Seconds: () => ({
    labelList: S(60, !0, "秒", 0),
    length: 60,
    textLength: 4,
    prop: "seconds"
  }),
  seconds: () => ({
    labelList: S(60, !1, "秒", 0),
    length: 60,
    textLength: 2.5,
    prop: "seconds"
  })
};
function ae({ format: e, gap: l, fontSize: t }) {
  const i = [];
  let r = 0;
  return e.reverse().forEach((n, u) => {
    const A = u * l, c = te[n];
    if (c) {
      const a = c();
      i.push({
        ...a,
        dWidth: (r + A) * 2
      }), r += a.textLength * t;
    }
  }), i.reverse();
}
function oe(e) {
  return e || e === 0 ? String(e).split("").map((t) => F[Number(t)]).join("") : "";
}
const re = { class: "seyu-shell" }, ie = /* @__PURE__ */ Object.assign({
  name: "CompassClock",
  inheritAttrs: !1
}, {
  __name: "CompassClock",
  props: {
    format: {
      type: Array,
      default: () => ["Year", "Month", "Day", "Week", "Hour", "Minute", "Seconds"]
    },
    // 每一圈的间距，单位像素
    gap: {
      type: Number,
      default: 10
    },
    // 字体大小，单位像素
    fontSize: {
      type: Number,
      default: 14
    },
    // 字体颜色
    color: {
      type: String,
      default: "#000000"
    },
    // 高亮颜色
    highlightColor: {
      type: String,
      default: "#09c"
    }
  },
  setup(e, { expose: l }) {
    V((a) => ({
      "7cd69d12": r.value
    }));
    const t = e, i = x(() => ae(t)), r = x(() => `${t.fontSize}px`), n = U({}), u = x(() => {
      const a = t.format || [];
      return a.includes("Year") ? `${oe(n.year)}年` : a.includes("year") ? `${n.year}年` : "";
    });
    let A;
    function c() {
      const a = /* @__PURE__ */ new Date();
      n.month = a.getMonth(), n.day = a.getDate() - 1, n.week = a.getDay(), n.hour = a.getHours(), n.minute = a.getMinutes(), n.seconds = a.getSeconds(), n.year = a.getFullYear(), A = setTimeout(c, 100);
    }
    return c(), l({
      start: () => {
        clearTimeout(A), c();
      },
      stop: () => {
        clearTimeout(A);
      }
    }), (a, o) => (D(), N("div", re, [
      (D(!0), N(v, null, L(i.value, (h, g) => (D(), N("div", {
        class: "seyu-time-text",
        key: g,
        style: O({
          width: `calc(100% - ${h.dWidth}px)`,
          height: `calc(100% - ${h.dWidth}px)`
        })
      }, [
        w("div", {
          class: "seyu-time-rotate",
          style: O({ transform: `rotate(-${360 / h.length * n[h.prop]}deg)` })
        }, [
          (D(!0), N(v, null, L(h.labelList, (p, B) => (D(), N("div", {
            key: B,
            style: O({
              transform: `translateY(-50%) rotate(${360 / h.length * B}deg)`,
              color: B === n[h.prop] ? t.highlightColor : t.color
            })
          }, T(p), 5))), 128))
        ], 4)
      ], 4))), 128)),
      w("div", {
        class: "seyu-time-year",
        style: O({ color: t.highlightColor })
      }, T(u.value), 5)
    ]));
  }
});
function ne(e, l) {
  const t = x(() => {
    var o;
    return ((o = e == null ? void 0 : e.value) == null ? void 0 : o.clientWidth) || 100;
  }), i = x(() => {
    var o;
    return ((o = e == null ? void 0 : e.value) == null ? void 0 : o.clientHeight) || 100;
  }), r = I(0);
  function n() {
    return l === "random" ? j() : Array.isArray(l) ? l[Math.floor(Math.random() * (l == null ? void 0 : l.length))] : "#000000";
  }
  function u(o) {
    return {
      ...o,
      y: Math.random() * (i.value * 0.7),
      x: Math.random() * t.value,
      resetDistance: i.value / 3
    };
  }
  function A(o = "") {
    return o.split("").map((g) => ({
      text: g,
      x: Math.random() * t.value,
      y: Math.random() * -120,
      h: r.value,
      color: n(),
      resetDistance: i.value / 3
    }));
  }
  function c(o = "") {
    return [{
      text: o,
      x: Math.random() * t.value,
      y: Math.random() * -120,
      h: r.value,
      color: n(),
      resetDistance: i.value / 3
    }];
  }
  function a(o, h, g) {
    switch (r.value = g, h) {
      case "split":
        return A(o);
      case "level":
        return c(o);
    }
  }
  return {
    getDrawItemList: a,
    getReset: u
  };
}
function X(e, l) {
  const t = x(() => {
    var A;
    return (A = e == null ? void 0 : e.value) == null ? void 0 : A.getContext("2d");
  }), i = I("color"), r = new Image();
  r.onload = function() {
    var A, c;
    i.value = "img", t.value.drawImage(r, 0, 0, (A = e.value) == null ? void 0 : A.width, (c = e.value) == null ? void 0 : c.height);
  };
  function n() {
    var A, c;
    t.value.fillStyle = l.bgColor, t.value.fillRect(0, 0, (A = e.value) == null ? void 0 : A.width, (c = e.value) == null ? void 0 : c.height), i.value = "color", l.bgImg.trim() && (r.src = l.bgImg);
  }
  function u() {
    var a, o;
    const [A = 0, c = 0] = [(a = e.value) == null ? void 0 : a.width, (o = e.value) == null ? void 0 : o.height];
    if (t.value.globalAlpha = 0.2, i.value === "img") {
      t.value.drawImage(r, 0, 0, A, c), t.value.globalAlpha = 1;
      return;
    }
    t.value.fillStyle = l.bgColor, t.value.fillRect(0, 0, A, c), t.value.globalAlpha = 1;
  }
  return {
    setBg: n,
    overlay: u
  };
}
const se = { class: "seyu-above" }, le = /* @__PURE__ */ Object.assign({
  name: "CodeRain",
  inheritAttrs: !1
}, {
  __name: "CodeRain",
  props: {
    // 背景图片
    bgImg: {
      type: String,
      default: ""
    },
    // 背景颜色
    bgColor: {
      type: String,
      default: "#000000"
    },
    // 文本内容
    textMsg: {
      type: String,
      default: "rain"
    },
    // 模式, split: 拆分文本; level: 水平绘制文本
    mode: {
      type: String,
      validator: (e) => ["split", "level"].includes(e),
      default: "split"
    },
    // 文字颜色, 在数组中随机挑选一个做为字体颜色或随机生成
    textColor: {
      type: [String, Array],
      validator: (e) => Array.isArray(e) || e === "random",
      default: "random"
    },
    // 字体大小
    fontSize: {
      type: String,
      default: "16px"
    },
    // 速度
    speed: {
      type: Number,
      default: 1,
      validator: (e) => e > 0
    }
  },
  setup(e, { expose: l }) {
    const t = e, i = I(), r = I(), n = I(0), { setBg: u, overlay: A } = X(r, t);
    function c() {
      var f, R, m;
      r.value && (r.value.width = ((f = i.value) == null ? void 0 : f.clientWidth) || 0, r.value.height = ((R = i.value) == null ? void 0 : R.clientHeight) || 0, n.value = ((m = i.value) == null ? void 0 : m.clientHeight) || 0, p(), u(), d());
    }
    let a;
    const o = U([]), { getDrawItemList: h, getReset: g } = ne(i, t.textColor);
    function p() {
      const { fontSize: f, textMsg: R, mode: m } = t;
      a.font = `${f} 楷体`;
      const M = a.measureText(R);
      let Q = M.width;
      const P = M.actualBoundingBoxAscent + M.actualBoundingBoxDescent, b = i.value.clientWidth / Q;
      o.splice(0, o.length);
      for (let H = 0; H < b; H++)
        o.push(h(R, m, P));
    }
    function B() {
      A(), a.globalAlpha = 1, o.forEach((f, R) => {
        f == null || f.forEach((m, M) => {
          const { color: Q, text: P, x: b, y: H, h: K, resetDistance: C } = m;
          a.fillStyle = Q, a.fillText(P, b, H);
          const z = H > n.value || Math.random() > 0.8 && C < 0;
          o[R][M] = z ? g(m) : { ...m, y: H + K, resetDistance: C - K };
        });
      });
    }
    let s;
    function d() {
      clearInterval(s), s = setInterval(B, t.speed * 17);
    }
    function y() {
      clearInterval(s);
    }
    return E(() => {
      J(i.value, Y(c)), a = r.value.getContext("2d");
    }), l({
      start: d,
      stop: y
    }), (f, R) => (D(), N("div", {
      class: "seyu-shell",
      ref_key: "codeRain",
      ref: i
    }, [
      w("canvas", {
        ref_key: "canvas",
        ref: r,
        class: "seyu-canvas"
      }, null, 512),
      w("div", se, [
        k(f.$slots, "default")
      ])
    ], 512));
  }
});
function Ae(e, l) {
  const t = I(), i = I(0);
  function r(u = 0) {
    var p;
    const { duration: A, direction: c, tilt: a } = e, o = c === "left" ? -1 : 1, h = 360 / A * (A - u) * o + i.value, g = 360 * o + h;
    i.value = h, t.value = (p = l.value) == null ? void 0 : p.animate(
      [
        { transform: `rotateX(${a}deg) rotateY(${h}deg)` },
        { transform: `rotateX(${a}deg) rotateY(${g}deg)` }
      ],
      {
        duration: A,
        iterations: 1 / 0
      }
    );
  }
  G(
    () => e.direction,
    () => {
      var u;
      r((u = t.value) == null ? void 0 : u.currentTime);
    }
  ), E(() => {
    r();
  });
  function n() {
    i.value = 0, r();
  }
  return {
    animates: t,
    restAnimates: n
  };
}
const ce = { class: "seyu-shell" }, ue = /* @__PURE__ */ Object.assign({
  name: "RotateCards",
  inheritAttrs: !1
}, {
  __name: "RotateCards",
  props: {
    // 数据源
    data: {
      type: Array,
      required: !0
    },
    // 方向
    direction: {
      type: String,
      validator: (e) => ["left", "right"].includes(e),
      default: "left"
    },
    // 旋转一圈的时间
    duration: {
      type: Number,
      validator: (e) => e > 0,
      default: 1e4
    },
    // 旋转半径
    radius: {
      type: [String, Number],
      default: "40%"
    },
    // 倾斜角度
    tilt: {
      type: Number,
      default: -10
    },
    // 旋转项自定义类名
    itemClass: {
      type: String,
      default: ""
    }
  },
  setup(e, { expose: l }) {
    const t = e, i = I(), r = I(0), n = x(() => {
      const { radius: a } = t;
      if (typeof a == "number")
        return `${a}px`;
      if (/^\d+px$/.test(a))
        return a;
      if (!/^\d+%$/.test(a))
        return "0px";
      const o = (Number(a.split("%")[0]) || 0) / 100;
      return (r.value * o || 0).toFixed(2) + "px";
    }), u = x(() => 360 / t.data.length), { animates: A, restAnimates: c } = Ae(t, i);
    return E(() => {
      J(i.value, Y(() => {
        var a;
        r.value = (a = i.value) == null ? void 0 : a.clientWidth;
      }));
    }), l({
      rest: c,
      start: () => {
        var a;
        (a = A.value) == null || a.play();
      },
      stop: () => {
        var a;
        (a = A.value) == null || a.pause();
      }
    }), (a, o) => (D(), N("div", ce, [
      w("div", {
        class: "seyu-rotate-container",
        ref_key: "containerRef",
        ref: i
      }, [
        (D(!0), N(v, null, L(t.data, (h, g) => (D(), N("div", {
          key: g,
          class: q(["seyu-rotate-item", t.itemClass]),
          style: O({
            transform: `translate(-50%, -50%) rotateY(${u.value * g}deg) translateZ(${n.value})`
          })
        }, [
          k(a.$slots, "default", { item: h })
        ], 6))), 128))
      ], 512)
    ]));
  }
});
function he(e, l) {
  const t = x(() => {
    var a;
    return (a = e == null ? void 0 : e.value) == null ? void 0 : a.getContext("2d");
  }), i = U([]);
  class r {
    constructor(o) {
      const {
        x: h,
        y: g,
        color: p,
        radius: B,
        cross: s,
        vertical: d,
        topple: y,
        alpha: f,
        decay: R,
        customDraw: m
      } = o;
      this.x = h, this.y = g, this.color = p, this.radius = B || 1, this.cross = s === 0 ? 0 : s || Math.random() * 2 - 1, this.vertical = d === 0 ? 0 : d || Math.random() * 2 - 1, this.topple = y === 0 ? 0 : y || 0.01, this.alpha = f || 1, this.decay = R || 0.01, this.customDraw = m;
    }
    draw() {
      var o;
      if (t.value.save(), t.value.globalAlpha = this.alpha, this.customDraw) {
        (o = this.customDraw) == null || o.call(this, {
          x: this.x,
          y: this.y,
          color: this.color
        }, t.value), t.value.restore();
        return;
      }
      t.value.beginPath(), t.value.arc(this.x, this.y, this.radius, 0, Math.PI * 2), t.value.fillStyle = this.color, t.value.fill(), t.value.restore();
    }
    update(o) {
      this.x += this.cross, this.y -= this.vertical, this.vertical -= this.topple, this.alpha -= this.decay, this.alpha <= 0 && (o == null || o());
    }
  }
  function n(a = []) {
    a.forEach((o) => {
      i.push(new r(o));
    });
  }
  class u {
    constructor(o) {
      const { x: h, y: g, end: p, radius: B, color: s, speed: d, callback: y } = o;
      this.x = h, this.y = g, this.end = p, this.radius = B, this.color = s, this.speed = d, this.callback = y;
    }
    draw() {
      var h;
      const o = ((h = e == null ? void 0 : e.value) == null ? void 0 : h.height) || 0;
      t.value.beginPath(), t.value.arc(this.x, o - this.y, this.radius, 0, Math.PI * 2), t.value.fillStyle = this.color, t.value.fill();
    }
    update(o) {
      var h;
      this.y += this.speed, this.y >= this.end && (o == null || o(), this.callback({
        x: this.x,
        y: ((h = e == null ? void 0 : e.value) == null ? void 0 : h.height) - this.y
      }));
    }
  }
  function A(a) {
    i.push(new u(a));
  }
  function c() {
    l == null || l(), i.forEach((a, o) => {
      a.draw(), a.update(() => i.splice(o, 1));
    }), requestAnimationFrame(c);
  }
  return E(() => {
    c();
  }), {
    canvasContext: t,
    fire: A,
    createShards: n
  };
}
const ge = ["irregularity", "circle"];
function de(e) {
  function l() {
    const { diffuseColor: n } = e;
    if (Array.isArray(n)) {
      const u = Math.floor(Math.random() * n.length);
      return n[u];
    }
    return j();
  }
  function t(n, u) {
    const { diffuseRadius: A } = e, c = [];
    for (let a = 0; a < 30; a++)
      c.push({ x: n, y: u, color: l(), radius: A });
    return c;
  }
  function i(n, u) {
    const A = [], a = Math.PI * 2 / 36;
    for (let o = 0; o < 36; o++)
      A.push({
        x: n,
        y: u,
        color: l(),
        radius: e.diffuseRadius,
        cross: Math.cos(a * o),
        vertical: Math.sin(a * o),
        topple: 0
      });
    return A;
  }
  function r(n = {}, u = ge) {
    const A = Math.floor(Math.random() * u.length), c = u[A], { x: a, y: o } = n;
    switch (c) {
      case "irregularity":
        return t(a, o);
      case "circle":
        return i(a, o);
      default:
        return t(a, o);
    }
  }
  return {
    getShape: r
  };
}
function pe(e, { fire: l, createShards: t, getShape: i }, r) {
  const n = I(0);
  function u() {
    const { riseColor: a } = e;
    if (Array.isArray(a)) {
      const o = Math.floor(Math.random() * a.length);
      return a[o];
    }
    return j();
  }
  function A() {
    const { height: a, width: o } = (r == null ? void 0 : r.value) || {};
    if (!(a > 0))
      return;
    const h = a / 2, { shape: g, riseSpeed: p, riseRadius: B } = e;
    n.value++, l({
      x: o * Math.random(),
      y: 0,
      end: h * Math.random() + h,
      radius: B,
      color: u(),
      speed: p,
      callback: (s) => {
        const d = i(s, g);
        t(d), n.value--, e.autoFire && A();
      }
    });
  }
  function c() {
    if (!e.autoFire)
      return;
    const a = e.riseCount - n.value;
    for (let o = 0; o < a; o++)
      setTimeout(A, 200);
  }
  return G(
    () => e.autoFire,
    () => {
      c();
    }
  ), {
    initAuto: c
  };
}
const Ie = { class: "seyu-above" }, Be = /* @__PURE__ */ Object.assign({
  name: "FireWorks",
  inheritAttrs: !1
}, {
  __name: "FireWorks",
  props: {
    // 背景图片
    bgImg: {
      type: String,
      default: ""
    },
    // 背景颜色
    bgColor: {
      type: String,
      default: "#000000"
    },
    // 上升烟花半径
    riseRadius: {
      type: Number,
      default: 2,
      validator: (e) => e > 0
    },
    // 上升烟花颜色
    riseColor: {
      type: [String, Array],
      validator: (e) => Array.isArray(e) || e === "random",
      default: "random"
    },
    // 上升烟花速度
    riseSpeed: {
      type: Number,
      default: 2,
      validator: (e) => e > 0
    },
    // 上升烟花数量
    riseCount: {
      type: Number,
      default: 5,
      validator: (e) => e > 0
    },
    // 扩散弹片半径
    diffuseRadius: {
      type: Number,
      default: 2,
      validator: (e) => e > 0
    },
    // 扩散弹片颜色
    diffuseColor: {
      type: [String, Array],
      validator: (e) => Array.isArray(e) || e === "random",
      default: "random"
    },
    // 自动发射
    autoFire: {
      type: Boolean,
      default: !0
    },
    // 形状
    shape: {
      type: Array
    }
  },
  setup(e, { expose: l }) {
    const t = e, i = I(), r = I(), { setBg: n, overlay: u } = X(r, t), { fire: A, createShards: c } = he(r, u), { getShape: a } = de(t), { initAuto: o } = pe(t, {
      fire: A,
      createShards: c,
      getShape: a
    }, r);
    function h() {
      var g, p;
      r.value && (r.value.width = ((g = i.value) == null ? void 0 : g.clientWidth) || 0, r.value.height = ((p = i.value) == null ? void 0 : p.clientHeight) || 0, n(), o());
    }
    return E(() => {
      J(i.value, Y(h));
    }), l({
      fire: A,
      createShards: c,
      getShape: a
    }), (g, p) => (D(), N("div", {
      class: "seyu-shell",
      ref_key: "fireWorks",
      ref: i
    }, [
      w("canvas", {
        ref_key: "canvas",
        ref: r,
        class: "seyu-canvas"
      }, null, 512),
      w("div", Ie, [
        k(g.$slots, "default")
      ])
    ], 512));
  }
});
const fe = [
  ee,
  ie,
  le,
  ue,
  Be
], me = {
  install(e) {
    fe.forEach((l) => {
      e.component(l.name, l);
    });
  }
};
export {
  le as CodeRain,
  ie as CompassClock,
  Be as FireWorks,
  ee as FloatDown,
  ue as RotateCards,
  me as default,
  Re as utils
};
